home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJTST200.ZIP / tests / libc / crt0 / mspn2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-07  |  628 b   |  28 lines

  1. #include <stdio.h>
  2. #include <go32.h>
  3. #include <stdlib.h>
  4. #include <dpmi.h>
  5.  
  6. extern short __djgpp_ds_alias;
  7.  
  8. int
  9. main(int argc, char **argv)
  10. {
  11.   int i;
  12.   short sel;
  13.   printf("%04lx : %04x %04x %04x %04x\n",
  14.      _go32_info_block.linear_address_of_transfer_buffer >> 4,
  15.      _my_cs(), _my_ds(), __djgpp_ds_alias, _go32_info_block.selector_for_linear_memory);
  16.   if (argc < 2)
  17.     return 0;
  18.   for (i=0; i<atoi(argv[1]); i++)
  19.   {
  20.     sel = __dpmi_allocate_ldt_descriptors(1);
  21.     printf("[%02d] %04x\n", i, sel);
  22.     __dpmi_free_ldt_descriptor(sel);
  23.     fflush(stdout);
  24.     system("teststub");
  25.   }
  26.   return 0;
  27. }
  28.